<%@ page language="java" contentType="text/html; charset=UTF-8" 
    pageEncoding="UTF-8"%> 
  <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 
<html> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 
<script type="text/javascript" src="<c:url value="/js/jquery-easyui-1.5.5.6/jquery.min.js"/>"></script>
<script type="text/javascript" src="<c:url value="/js/jquery-easyui-1.5.5.6/jquery.easyui.min.js"/>"></script>
<script type="text/javascript" src="<c:url value="/js/jquery-easyui-1.5.5.6/locale/easyui-lang-zh_CN.js"/>"></script>
<link rel="stylesheet" href="<c:url value="/js/jquery-easyui-1.5.5.6/themes/icon.css"/>"/>
<link rel="stylesheet" href="<c:url value="/js/jquery-easyui-1.5.5.6/themes/default/easyui.css"/>"/>
<title>新增员工</title>
</head>
<body>
	<script type="text/javascript">
		$(function(){
			$('#ygid').textbox({
				icons: [{
					iconCls:'icon-add',
					handler: function(e){
						 $("#jobplanqygxz").dialog("open");
						//双击获取值
						$(".zpjttksuoygxz").datagrid({onDblClickRow:function(index,row){
							var stainId = row.stainId;
							var stainName = row.stainName;
							var defideName = row.defideName;
							var positionName = row.positionName;
							$("#ygid").textbox("setValue",stainId);
							$("#ygname").textbox("setValue",stainName);
							$("#bm").textbox("setValue",defideName);
							$("#jobplanqygxz").dialog("close");
						}}); 
					}
				}]

			});
			
			
			$('#wdm_ygzttable_tjjcgl').linkbutton({onClick:function(){
				if($("#ygid").textbox("getText")==""){
					$.messager.confirm("提示","请填写全部内容",function(r){
						
					});
				}else{
					$("<form method='post'>").appendTo(document.body).form({
						url: 'insert_ygzttable_add',
						onSubmit: function(params){
							
							params["stainId"] = $("#ygid").textbox("getText");
							params["stainName"] = $("#ygname").textbox("getText");
							params["ygztPerson"] = $("#zdrygztbd").textbox("getText");
							params["ygztDate"] = $("#ygztbdrq").textbox("getText");
							params["ygztBeizhu"] = $("#ygztbeizhu").textbox("getText");
							params["jobsName"] = $("#ygztxzt").combobox("getText");
							params["jobsId"] = $("#ygztxzt").combobox("getValue");
							params["ygztStartdate"] = $("#ygztbdrqzdsj").textbox("getText");
						},success:function(v){
							v = eval("(" + v + ")");
							if(v.success){
									 $(".yglz-wdm-ygzttables").panel({
										href:'to_ygzttable'
									});	 
								
							}else{
								$.messager.alert('错误', '对不起，操作失败，原因：' + v.message);
							}
						}
					}).submit();
				}
				
			}});

			
			//返回上一级事件
			$(".ygzt_insert_back").linkbutton({
				onClick:function(){
					$(".yglz-wdm-ygzttables").panel({
						href:'to_ygzttable'
					});	
				}
			});
		});
	</script>
	<div id="toolbar_contract_insert_insert">
		<a href="#" class="easyui-linkbutton ygzt_insert_back" data-options="iconCls:'icon-reload',plain:true,text:'返回',iconAlign:'left'"></a>
	</div>
	<div style="width:1000px;margin-top:10px;margin-left:10px;font-size:14px;">
		<div style="font-size:14px;">概要</div>
		<div style="border-top:2px solid #2B91D5;width:400px;height:150px;float:left;margin-right:15px;">
			<table cellspacing="10">
				<tbody>
					<tr>
						<td align="right">*员工编号</td>
						<td><input class="easyui-textbox staffid" id="ygid" /></td>
					</tr>
					<tr>
						<td align="right">员工名称</td>
						<td><input class="easyui-textbox" id="ygname"/></td>
					</tr>
					<tr>
						<td align="right">部门</td>
						<td><input class="easyui-textbox" id="bm"/></td>
					</tr>
					
					
				</tbody>
			</table>
		</div>
		<div style="border-top:2px solid #2B91D5;width:400px;float:left;">	
			<table cellspacing="10">
				<tbody>
					
					<tr>
						<td width="100px" align="right">制单人</td>
						<td><input class="easyui-textbox" id="zdrygztbd" value="${staff.stainName}"/></td>
					</tr>
					<tr>
						<td align="right">制单日期</td>
						<td><input type= "text" class= "easyui-datetimebox" id="ygztbdrqzdsj"/></td>
					</tr>			
				</tbody>
			</table>
		</div>
		<div style="font-size:14px;width:200px;">内容</div>
		<div style="border-top:2px solid #2B91D5;width:400px;height:200px;float:left;margin-right:15px;">
			<table cellspacing="10">
				<tbody>
					<tr>
						<td align="right">变动日期</td>
						<td><input type= "text" class= "easyui-datetimebox" id="ygztbdrq"/></td>
					</tr>
					<tr>
						<td align="right">新状态</td>
						<td><input type= "text" class= "easyui-combobox" id="ygztxzt" data-options="url:'query_Employment_status',valueField:'jobsId',textField:'jobsName',panelHeight:'auto'" id="combobox_ygzztablexzdxzt"/></td>
					</tr>
				</tbody>
			</table>
		</div>
		
		<div style="font-size:14px;width:200px;">备注</div>
		<div style="margin-left:30px;margin-top:10px;">
			<input class="easyui-textbox " id="ygztbeizhu"  data-options="width:800,height:40,validType:'mobile',prompt:'备注',multiline:true"> 
		</div>
		
		
		
		
		<div style="border-top:2px solid #2B91D5;width:830px;height:10px;clear:both;margin-top:30px;"></div>
		<a class="easyui-linkbutton" id="wdm_ygzttable_tjjcgl" style="margin-left:30px;width:100px;">添加</a>
	</div>
	
<div class="easyui-dialog" id="jobplanqygxz" data-options="width:550,title:'员工信息',
				modal:true,
				closed:true,
				buttons:[{
					text:'确定',
					iconCls:'icon-ok',
					handler:function(){
						$('#jobplanqygxz').form({
							onSubmit:function(){
								var row = $('#ygxxcx').datagrid('getSelected');
								var stainId = row.stainId;
								var stainName = row.stainName;
								var defideName = row.defideName;
								var positionName = row.positionName;
								$('#ygid').textbox('setValue',stainId);
								$('#ygname').textbox('setValue',stainName);
								$('#bm').textbox('setValue',defideName);
							},success:function(v){
								$('#jobplanqygxz').dialog('close');	
								
							}
						}).submit();
					}
				},{
					text:'取消',
					iconCls:'icon-clear',
					handler:function(){
						$('#jobplanqygxz').dialog('close');			
					}
				}]">
				<form action="" method="post" >
					<div class="line">
						<input class="easyui-textbox" id="" name="plandescribe" data-options="label:'员工名称',width:300" style="padding:10px 0px"/>
						<a class="easyui-linkbutton" id="" data-options="text:'搜索',width:100" style="float:right"></a>
					</div>
					<div class="line">
						<table id="ygxxcx" width="100%" class="easyui-datagrid zpjttksuoygxz" data-options="
							url:'queryByto_db_staffinformation',
							pagination:true,
							pageSize:2,
							pageList:[2,4,6,8,10],
							autoRowHeight:true,
							nowrap:false,
							rownumbers:true,
							singleSelect:true,
							striped:true,
							fitColumns:true">
							<thead>
							  <tr>
								<th width="20%" data-options="align:'center',field:'stainId'">员工编号</th>
								<th width="20%" data-options="align:'center',field:'stainName'">员工名称</th>
								<th width="20%" data-options="align:'center',field:'defideName'">员工部门</th>
							  </tr>
							</thead>
							<tbody>
							  
							</tbody>
						</table>
					</div>
				</form>
			</div>	
	
	
	

		

	
</body>
</html>